import axios from './config/axios.default.config';
import defaultConfig from "@/config/config.default";

class AuthorService {
    async registerUser(formData) {
        return axios.post(`${defaultConfig.baseApiUrl}/identifyAuthentication/registerUser`, formData)
    }

    async checkUserPermission() {
        return axios.get(`${defaultConfig.baseApiUrl}/identifyAuthentication/checkPermission`)
    }

    async loginUser(formData) {
        return axios.post(`${defaultConfig.baseApiUrl}/identifyAuthentication/loginUser`, formData)
    }


    async updateUserInfo(formData) {
        return axios.post(`${defaultConfig.baseApiUrl}/identifyAuthentication/updateUserInfo`, formData)
    }

    async getUnapprovedUserList(args) {
        return axios.get(`${defaultConfig.baseApiUrl}/identifyAuthentication/unapprovedUser`, {
            params:args
        })
    }

    async approvedUser(args) {
        return axios.post(`${defaultConfig.baseApiUrl}/identifyAuthentication/approvedUser`, args)
    }

    async getAllUserList(args) {
        return axios.get(`${defaultConfig.baseApiUrl}/identifyAuthentication/unAllUser`, {
            params:args
        })
    }
    async unApprovedUser(args) {
        return axios.post(`${defaultConfig.baseApiUrl}/identifyAuthentication/unApprovedUser`, args)
    }
    async deleteUser(args) {
        return axios.post(`${defaultConfig.baseApiUrl}/identifyAuthentication/deleteUser`, args)
    }

    async setAdmin(args) {
        return axios.post(`${defaultConfig.baseApiUrl}/identifyAuthentication/setAdmin`, args)
    }

    async cancelAdmin(args) {
        return axios.post(`${defaultConfig.baseApiUrl}/identifyAuthentication/cancelAdmin`, args)
    }


    async getuserReginsterInfo() {
        return axios.get(`${defaultConfig.baseApiUrl}/identifyAuthentication/userReginsterInfo`)
    }

}


export default new AuthorService()
